import {
	mapState,
	mapMutations
} from 'vuex';
// import comLogin from '@/components/comLogin'
export default {
	install(Vue) {
		Vue.mixin({
			// components:{comLogin},
			computed: mapState(['hasLogin', 'userInfo', 'access_token','isLoading']),
			data() {
				return {

				}
			},
			methods: {
				...mapMutations([
					'storeLogin',
					'storeLogout',
					'storeLoading',
				]),

				showNameByCode(code, datalist, keyname, valuename) {
					let val = "";
					if (datalist != null) {
						for (var i = 0; i < datalist.length; i++) {
							if (datalist[i][keyname] == code) {
								val = datalist[i][valuename];
								break;
							}
						}
					}
					return val;
				},




			},
			// onPullDownRefresh() {
			// 	if (!this.hasLogin) {
			// 		setTimeout(() => {
			// 			uni.stopPullDownRefresh()
			// 		}, 800)
			// 	}
			// },
			onShow() {

			},
			watch: {

			}
		})
	}
}
